Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: multiple consistency levels for authz checks #832

Merged
merged 1 commit into from
Dec 16, 2024
Merged

Conversation

kushsharma
Copy link
Member

So far frontier was either using no consistency level from spicedb which defaults to prioritise minimum latency with minimal consistent results as well. Other was fully consistent calls which provide the most accurate authz resolution but takes substantial latency hit. A middle ground is introduced now that caches the zookie generated during the last fully consistent check and uses that in all but Check calls. This should speed up Lookup/List calls for authz.

The existing config fully_consistent is now deprecated in favor of a new consistency level.

spicedb:
  # consistency ensures Authz server consistency guarantees for various operations
  # Possible values are:
  # - "full": Guarantees that the data is always fresh although API calls might be slower than usual
  # - "best_effort": Guarantees that the data is the best effort fresh [default]
  # - "minimize_latency": Tries to prioritise minimal latency
  consistency: "best_effort"

Copy link

vercel bot commented Dec 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontier ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 4:36am

So far frontier was either using no consistency level from spicedb
which defaults to prioritise minimum latency with minimal consistent
results as well. Other was fully consistent calls which provide the
most accurate authz resolution but takes substential latency hit.
A middle ground is introduced now that caches the zookie generated
during the last fully consistent check and uses that in all but
Check calls. This should speed up Lookup/List calls for authz.

Existing config `fully_consistent` is now deprecated in favor of
new consistency level.
```
spicedb:
  # consistency ensures Authz server consistency guarantees for various operations
  # Possible values are:
  # - "full": Guarantees that the data is always fresh although API calls might be slower than usual
  # - "best_effort": Guarantees that the data is the best effort fresh [default]
  # - "minimize_latency": Tries to prioritise minimal latency
  consistency: "best_effort"
```

Signed-off-by: Kush Sharma <[email protected]>
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12309660899

Details

  • 3 of 54 (5.56%) changed or added relevant lines in 2 files are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 30.395%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/serve.go 0 11 0.0%
internal/store/spicedb/relation_repository.go 3 43 6.98%
Files with Coverage Reduction New Missed Lines %
internal/store/spicedb/relation_repository.go 4 1.03%
Totals Coverage Status
Change from base Build 12293636285: -0.03%
Covered Lines: 7670
Relevant Lines: 25234

💛 - Coveralls

@rsbh rsbh self-requested a review December 13, 2024 10:01
@kushsharma kushsharma merged commit 89fbe30 into main Dec 16, 2024
7 checks passed
@kushsharma kushsharma deleted the sdb-token branch December 16, 2024 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants